//
// * Copyright (c) 2002-2009 "Neo Technology,"
// *     Network Engine for Objects in Lund AB [http://neotechnology.com]
// *
// * This file is part of Neo4j.
// * 
// * Neo4j is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Affero General Public License as
// * published by the Free Software Foundation, either version 3 of the
// * License, or (at your option) any later version.
// * 
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// * GNU Affero General Public License for more details.
// * 
// * You should have received a copy of the GNU Affero General Public License
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
// 
namespace org.neo4j.kernel.impl.nioneo.xa
{

	using PropertyIndex = org.neo4j.kernel.impl.core.PropertyIndex;
	using PropertyData = org.neo4j.kernel.impl.nioneo.store.PropertyData;
	using ArrayMap = org.neo4j.kernel.impl.util.ArrayMap;

///
/// <summary> * Defines the operations in Neo4j kernel that are node related. </summary>
/// 
	public interface NodeEventConsumer
	{
///    
///     <summary> * Creates a node. The <CODE>nodeId</CODE> is the position of the record
///     * where the node will be created.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node </param>
///     * <exception cref="IOException">
///     *             If unable to create or if node already exist </exception>
///     
		void createNode(int nodeId);

///    
///     <summary> * Deletes a node. The <CODE>nodeId</CODE> is the position of the record
///     * where the node exist and will be deleted.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node </param>
///     * <exception cref="IOException">
///     *             If </exception>
///     
		void deleteNode(int nodeId);

///    
///     <summary> * Checks if a node exists. If the record <CODE>nodeId</CODE> is in use
///     * <CODE>true</CODE> is returned.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node </param>
///     * <returns> True if node exists </returns>
///     * <exception cref="IOException">
///     *             If unable to check for node </exception>
///     
		bool loadLightNode(int nodeId);

///    
///     <summary> * Adds a property to the node.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node to add the property to </param>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <param name="key">
///     *            The key of the property </param>
///     * <param name="value">
///     *            The value of the property </param>
///     * <exception cref="IOException">
///     *             If unable to add property </exception>
///     
		void addProperty(int nodeId, int propertyId, PropertyIndex index, object value);

///    
///     <summary> * Changes the value of a property on a node.
///     *  </summary>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <param name="value">
///     *            The new value </param>
///     * <exception cref="IOException">
///     *             If unable to change property </exception>
///     
		void changeProperty(int nodeId, int propertyId, object value);

///    
///     <summary> * Removed a property from a node.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node </param>
///     * <param name="propertyId">
///     *            The id of the property </param>
///     * <exception cref="IOException">
///     *             If unable to remove property </exception>
///     
		void removeProperty(int nodeId, int propertyId);

///    
///     <summary> * Returns all properties connected to a node.
///     *  </summary>
///     * <param name="nodeId">
///     *            The id of the node </param>
///     * <returns> An array containing all properties connected to the node </returns>
///     * <exception cref="IOException">
///     *             If unable to get the properties </exception>
///     
		ArrayMap<int, PropertyData> getProperties(int nodeId);
	}
}